/**
 * Copyright (c) 2020-2021 浦东大爷 All rights reserved.
 * 机会永远都是留给有准备的人
 */
package com.lagou.controller;

import com.lagou.common.Const;
import com.lagou.common.ServerResponse;
import com.lagou.service.IIndustryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.management.ObjectName;
import java.util.Map;

/**
 * @author: gitwo
 * @date: 2021-03-10
 * @description:
 */
@Controller
@RequestMapping("/industry")
public class IndustryController {

    @Autowired
    private IIndustryService iIndustryService;

    @RequestMapping(value = "countCityNums.do", method = RequestMethod.POST)
    @ResponseBody
    public ServerResponse<Map<String, Object>> countCityNums(){
        ServerResponse<Map<String, Object>> response = iIndustryService.countCityData();
        return response;
    }

    @ResponseBody
    @RequestMapping(value = "industryTop.do", method = RequestMethod.POST)
    public ServerResponse<Map<String, Object>> getIndustryTop(){
        ServerResponse<Map<String, Object>> response = iIndustryService.getIndustryTop();
        return response;
    }

    /**
     * 热门行业对比图
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "industryCompare.do", method = RequestMethod.POST)
    public ServerResponse<Map<String, Object>> getIndustryCompare(){
        ServerResponse<Map<String, Object>> response = iIndustryService.getIndustryCompare();
        return response;
    }

    /**
     * 获取平均工资最高的十个城市
     * @return
     */
    @RequestMapping(value = "averagePay.do", method = RequestMethod.POST)
    @ResponseBody
    public ServerResponse<Map<String, Object>> getAveragePay(){
        ServerResponse<Map<String, Object>> response = iIndustryService.getAveragePay();
        return response;
    }
}
